import { HttpSrv } from 'lfun-bg-comp';
import { PageResult, Result } from '..';

export interface SysConfig {
  config_name: string;
  config_value: string;
  school_id: any;
  id?: any;
}

/** 更新 */
export const updateSysConfig = (params: SysConfig): Result<any> => {
  return HttpSrv().put('/school/v1/system/system-config', params);
};
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const getSysConfig = (school_id: any): Result<PageResult<SysConfig>> => {
  return HttpSrv().get('/school/v1/system/system-config', { params: { school_id, page: 1, per_page: 100 } });
};

export const createSysConfig = (params: SysConfig): Result<any> => {
  return HttpSrv().post('/school/v1/system/system-config', params);
};
